Skip to content

Conversation

@QuietMisdreavus
Copy link
Contributor

@QuietMisdreavus QuietMisdreavus commented Nov 14, 2025

fixes #1087

When colorized lint diagnostics were introduced, the source-location and message were printed in ANSI bold white, which caused an issue when using swift-format in a light-mode terminal theme. This PR changes the behavior to instead print these components in bold plain-color text, allowing them to inherit their color from the active terminal theme.

Using the same example i screenshotted in the above-linked issue, this is what the output looks like now:

image

case boldYellow = "1;33"
case boldMagenta = "1;35"
case boldWhite = "1;37"
case boldGray = "1;90"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we actually have any right now, but presumably boldGray has similar issues?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like boldGray is used for note-level emissions, which are used by a handful of rules for notes attached to their primary warning. I ran a quick test on my active theme and one of the built-in themes in the macOS Terminal, and it does seem pretty low-contrast in both versions 😅

image image

I wonder if we can downgrade that to just bold if we also take @allevato's suggestion of printing the location in plain (non-bold) text... 🤔

Copy link
Member

@allevato allevato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Co-authored-by: Tony Allevato <tony.allevato@gmail.com>
@QuietMisdreavus
Copy link
Contributor Author

After removing the bold style from the source locations, here's what the lints currently look like in my active terminal theme...

image image

This aligns the color of warning labels with the Swift compiler by
making them yellow instead of magenta. Diagnostic categories were
changed to make them not share a color with the warning labels.
@QuietMisdreavus
Copy link
Contributor Author

@allevato If the current version is fine with you (i updated the screenshot in the PR description) then can you go ahead and merge it? I don't have access to the button here. 😅

@allevato allevato merged commit bcd6a0f into swiftlang:main Nov 14, 2025
28 of 29 checks passed
@allevato
Copy link
Member

I thought I didn't have the ability to override the failing Windows check but it looks like that changed? Merged, thanks for the fix!

@QuietMisdreavus QuietMisdreavus deleted the plain-bold branch November 14, 2025 23:38
@bnbarham
Copy link
Contributor

bnbarham commented Nov 17, 2025

I thought I didn't have the ability to override the failing Windows check but it looks like that changed?

I've marked it as not required until I look into it further/remove it entirely 😅 (it's still the docc issue, but is presumably a SwiftPM bug given it works in 6.0+)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lint output uses illegible text color in light-mode terminals

3 participants